<?php

/*
 * Victory Reaction
 * 
 * 3$
 * 
 * 2 vp
 * When you discard this other than during a Clean-up phase, you may reveal it. If you do, gain a Gold.
 * 
 */

class Tunnel extends Card implements iReaction, iVictory, iKingdom, iHinterlands {

    public function __construct() {
        parent::__construct("Tunnel", 3);
        $this->undoPlay = false;
        $this->undoBuy = true;

        $this->victoryPoints = 2;
    }

    public function discard(Game $game, $name) {
        $options = array(new Option(1, "Yes"), new Option(2, "No"));
        $output = MySocket::GetUserReply($game, Input_ChooseOne, $options, 1, 1, null, "Reveal tunnel?");
        $answer = $output[0];
        if ($answer == "Yes") {
            $gold = $game->moveCardFromPileToPile("Gold", BoardCards, DiscardPile);
            ScreenDisplay::addScreenMessage($game, true, "gain " . nicePrint($gold), "gains " . ScreenDisplay::$LMSG, $name);
            $game->setTempCard($this);
        }
    }

    public function getDescription() {
        return array(
            "2 vp",
            "When you discard this other than during a Clean-up phase, you may reveal it. If you do, gain a Gold.");
    }

}